
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>厨房工作安排</title>
  <meta name="renderer" content="webkit">
   <#assign base=request.contextPath  />
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="${base}/js/layui/css/layui.css"  media="all">
<script src="${base}/js/zhang.js"></script>
 <style type="text/css">
  	.tk10{

			   margin: 0;
			    border: solid 2px #1E9FFF;
			    position: absolute;
			    left: 30%;
			    bottom: 40%;
			    background: white;
			    line-height: 40px;
			    margin-left: 10px;
			    display: none;
			    font-size:16px;
			}
				button{
				border-radius: 10px  10px  10px  10px;
			}
 </style>
</head>
<body>
	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
  <legend>厨房工作安排</legend>
</fieldset>

		    	<button class="layui-btn layui-btn-warm btn111" type="button" style="background-color:#1E9FFF">添加工作人</button>
		    	<table class="layui-table" lay-data="{url:'${base}/kitchenArrange/selectKitchen',toolbar: '#toolbarDemo',defaultToolbar: ['filter', 'print', 'exports'],page: true,id: 'testReload'}">
		     <thead>
			    <tr>
			      <th lay-data="{field:'createTime',align: 'center'}">时间</th>
			       <th lay-data="{field:'fillName',align: 'center'}">姓名</th>

                    <th lay-data="{field:'createTime',templet:function(val){
                                                                     if(val.isFinsh=='1'){
                                                                        return '已完成';
                                                                       }else{
                                                                         return '未完成';
                                                                            }
                                                                   },align: 'center'}">完成月子餐单制作</th>
                    <th lay-data="{field:'foodMaterial',templet:function(val){
                                                                    if(val.foodMaterial=='1'){
                                                                       return '新鲜';
                                                                      }else{
                                                                        return '不新鲜';
                                                                          }
                                                                        },align: 'center'}">核对生鲜配送公司菜品</th>
                    <th lay-data="{field:'security',templet:function(val){
                                                                  if(val.security=='1'){
                                                                  return '已完成';
                                                                     }else{
                                                                      return '未完成';
                                                                }
                                                                  },align: 'center'}">卫生状况及消防安全</th>

			    </tr>
			  </thead>
			</table>

<div class="tk10">
<div  style="height: 40px;background-color:#1E9FFF;text-align: center;color: white;" >
			      厨房工作安排
				</div>
	    <form  action="" method="get" style="padding: 5px;">
	      <div  id="tankuang2">
		       	姓名:<input type="text" id="name" value="" /><br/>
		       	 时间:<input type="text" id="time" value="" /><br/>
		       	是否完成:
		       	<select id="competle" name="type">
                <option value="1">已经完成</option>
                <option value="2">未完成</option>
                </select><br/>
                	是否新鲜:
                		       	<select id="foodMaterial" name="type">
                                <option value="1">新鲜</option>
                                <option value="2">不新鲜</option>
                                </select><br/>
                                	是否安全:
                                		       	<select id="security" name="type">
                                                <option value="1">安全</option>
                                                <option value="2">危险</option>
                                                </select>
			</div>
	      <div style="text-align:center;">
				<button class="layui-btn layui-btn-warm" type="button"  style="background-color:#1E9FFF" onclick="kitchen()">提交</button>
				<input type="button" value="取消" style="background-color:#1E9FFF" class="layui-btn layui-btn-warm" onclick="javaScript:window.location.reload();"></input>
			 </div>
		</form>
</div>


<script src="${base}/js/layui/layui.js" charset="utf-8"></script>
<script src="${base}/js/jquery.min.js"></script>
<script>
	$(".btn111").click(function(){
			$(".tk10").show(200)
			})
	layui.use(['element','table'], function(){
		var table = layui.table
	  var $ = layui.jquery
	  ,element = layui.element;

	  //触发事件
	  var active = {
	    tabChange: function(){
	      //切换到指定Tab项
	      element.tabChange('demo', '22');
	    }
	  };
	});
//是否完成月子餐单制作
	function kitchen(){
           var name = $("#name").val();
           var time = $("#time").val();
           var compelte = $("#competle").val();
           var foodMaterial = $("#foodMaterial").val();
           var security = $("#security").val();

             $.ajax({
                 type:"POST",
                 url:"${base}/kitchenArrange/addbakitchenArrange",
                 data:{"fillName":name,"createTime":time,"isFinsh":compelte,"foodMaterial":foodMaterial,"security":security},
                 success:function(data){
                     var table = layui.table;
                                 table.reload('testReload', {
                                 url: '${base}/kitchenArrange/selectKitchen'
                                 ,where: {},
                                 });
                                 $(".tk10").hide(200)
                             }
             });
	}






</script>
</body>
</html>